public class Solution2278 {
    public int percentageLetter(String s, char letter) {
        int c=0;
        for (char c1 : s.toCharArray()) {
            if (c1==letter){
                c++;
            }
        }
        return c*100/s.length();
    }

    public static void main(String[] args) {
        System.out.println(new Solution2278().percentageLetter("foobar",'o'));
    }
}
